Home > Use Cases > Adding a VM to Altaro Configuration

Adding a VM to Altaro Configuration

A sample SessionToken will be used throughout this use case.
The sample SessionToken will be: e65aedeb-a0e7-440c-8309-1cc0bcd920db

Before a VM can be managed, a call must be made which adds the VM to the Altaro Configuration. A VM cannot be added to a backup location, or to a schedule, if it is not configured. Apart from this, un-configured VMs cannot be backed up by Altaro VM Backup. Hence, it must be ensured that before any aspect of a VM is managed, it should be first added to the Altaro configuration. Before adding to the configuration, the AltaroVirtualMachineRef does not yet exist, and hence, the HypervisorVirtualMachineRef must be used instead. The response of this call is the newly generated AltaroVirtualMachineRef, which can then be used to manage the VM. After the above VMs list method is called, a HypervisorVirtualMachineRef can be selected from the Response, and provided to this API call in order to add it to the configuration. For illustrative purposes, the following sample GUID is going to be used to represent the HypervisorVirtualMachineRef:

HypervisorVirtualMachineRef: 9a5c8786-ced2-429e-91ec-df21fe9a1b5d

 

The following POST request adds the above VM to the Altaro VM Backup configuration:

http://localhost:35113/api/vms/enable-configuration/e65aedeb-a0e7-440c-8309-1cc0bcd920db/9a5c8786-ced2-429e-91ec-df21fe9a1b5d

 

As previously mentioned, there is not guarantee for the HypervisorVirtualMachineRef to be unique, especially when a VM has been cloned. For this reason, a situation might arise where there is a duplicate HypervisorVirtualMachineRef within different Hypervisors. If this is the case, the above call will not succeed since there is a conflict in the GUIDs. However, the AltaroHypervisorRef can be additionally specified to fix this problem. The AltaroHypervisorRef can also be retrieved from the VMs list API call. For illustrative purposes, the following sample GUID is going to be used to represent the AltaroHypervisorRef:

AltaroHypervisorRef: f85c4bcd-9955-47fa-a9c4-7c21fdf78620

 

The following POST request adds the above VM, which resides in the above Hypervisor to the Altaro VM Backup configuration:

http://localhost:35113/api/vms/enable-configuration/e65aedeb-a0e7-440c-8309-1cc0bcd920db/9a5c8786-ced2-429e-91ec-df21fe9a1b5d/f85c4bcd-9955-47fa-a9c4-7c21fdf78620

 

For this example, it is going to be assumed that any of the above two calls returned the following newly generated AltaroVirtualMachineRef:

AltaroVirtualMachineRef: ba2e9cdc-0d85-48e6-8db7-a45c5a40819e

 

Note: A full list of available API commands can be found here